﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using MyHotel_DTO;
using MyHotel_DAO;

namespace MyHotel_DAOWS
{
    /// <summary>
    /// Summary description for PhongDAOWS
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class PhongDAOWS : System.Web.Services.WebService
    {
        PhongDAO _phongDAO = new PhongDAO();

        [WebMethod]
        public List<Phong> getListPhong()
        {
            
            return _phongDAO.getListPhong();
        }

        [WebMethod]
        public List<Phong> getListPhongTrong()
        {
            
            return _phongDAO.getListPhongTrong();
        }


        [WebMethod]
        public List<Phong> getDSPhongDangThue()
        {
            return _phongDAO.getDSPhongDangThue();
        }

        [WebMethod]
        public List<Phong> getListPhongbyMaLoai(int maloai)
        {
            return _phongDAO.getListPhongbyMaLoai(maloai);
        }

        [WebMethod]
        public bool themPhong(Phong phong)
        {
            return _phongDAO.themPhong(phong);
        }

        [WebMethod]
        public bool CheckPhongByTenPhong(string tenphong)
        {
            return _phongDAO.CheckPhongByTenPhong(tenphong);
        }

        [WebMethod]
        public bool capNhatPhong(Phong phong)
        {
            return _phongDAO.capNhatPhong(phong);
        }

        [WebMethod]
        public bool xoaPhong(Phong phong)
        {
            return _phongDAO.xoaPhong(phong);
        }

        [WebMethod]
        public bool CheckPhongByTenPhong_MaPhong(string tenphong, int maphong)
        {
            return _phongDAO.CheckPhongByTenPhong_MaPhong(tenphong, maphong);
        }  
    }
}
